#pragma once

#include <string>
#include <vector>
#include <iostream>

#include "Poco/Net/HTTPRequest.h"

using Poco::Net::HTTPRequest;

using namespace std;

#define RESOURCE_HEADER "resource"
#define INVALID_RESOURCE_ID -1

/* HttpGetRequest class
 * wrapper for the needed Poco:Net
 */
class HttpGetRequest {
public:
    /* HttpGetRequest c'tor
     * sends the GET request to the given server
     * throws Exception on connection failure or response code other than [200,204]
     * method string should be one of [HttpGetRequest::HTTP_GET,HttpGetRequest::HTTP_POST]
     */
	HttpGetRequest(const string& method, const string& serverAddress, unsigned short port, const string& path);
    /* getter for the HTTP status code */
    unsigned int getStatus();
    /* getter for the HTTP reason string */
	string getReason();
    /* getter for the HTTP body */
	string getResponse();
    /* getter for the HTTP body as a vector */
    vector<unsigned char> getResponseVector();
    /* getter for the HTTP header "resource" */
    int getResourceId();
    /* valid method for HttpGetRequest c'tor */
    static string HTTP_GET;
    /* valid method for HttpGetRequest c'tor */
    static string HTTP_POST;    
private:
	unsigned int statusCode;
	string reason;
	string response;
    int resource;
};

